﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Data
{
    public class context : DbContext
    {
        static context()
        {
            Database.SetInitializer<context>(null);
        }

        public context()
            : base("Name=context")
        {
        }

        public DbSet<Consulta> Consultas { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
            Database.SetInitializer(new CreateDatabaseIfNotExists<context>());
            Database.SetInitializer(new DropCreateDatabaseIfModelChanges<context>());
        }
    }
}
